<script setup lang="ts">
import { useRouter } from 'vue-router'

const router = useRouter()

const goToChat = () => {
  router.push('/chat')
}
</script>

<template>
  <div class="home">
    <div class="hero">
      <h1>欢迎使用 AI 对话助手</h1>
      <p class="hero-description">
        这是一个功能强大的 AI 对话应用，支持多种 Function Call 功能，
        包括天气查询、计算器、网络搜索和翻译等。
      </p>
      <button @click="goToChat" class="cta-button">
        开始对话
      </button>
    </div>
    
    <div class="features">
      <h2>主要功能</h2>
      <div class="feature-grid">
        <div class="feature-card">
          <div class="feature-icon">💬</div>
          <h3>智能对话</h3>
          <p>与 AI 助手进行自然流畅的对话交流</p>
        </div>
        <div class="feature-card">
          <div class="feature-icon">🔧</div>
          <h3>Function Call</h3>
          <p>支持天气查询、计算器、搜索、翻译等多种功能</p>
        </div>
        <div class="feature-card">
          <div class="feature-icon">📝</div>
          <h3>对话记录</h3>
          <p>完整保存对话历史，支持查看和回顾</p>
        </div>
        <div class="feature-card">
          <div class="feature-icon">⚡</div>
          <h3>实时响应</h3>
          <p>快速响应，流畅的用户体验</p>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
.home {
  min-height: calc(100vh - 60px);
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero {
  text-align: center;
  padding: 4rem 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 16px;
  margin-bottom: 4rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero-description {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.cta-button {
  background: white;
  color: #667eea;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.features {
  text-align: center;
}

.features h2 {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  color: #333;
  font-weight: 600;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border: 1px solid #e0e0e0;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #333;
  font-weight: 600;
}

.feature-card p {
  color: #666;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 768px) {
  .home {
    padding: 1rem;
  }
  
  .hero {
    padding: 2rem 1rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .features h2 {
    font-size: 2rem;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
</style>
